"""
URL configuration for djangoProject_day01 project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin

from django.urls import path

# 导入处理静态资源文件的函数static
from django.conf.urls.static import static

from . import settings
# 导入视图函数
from .views import index,Login,Reg,Ucenter,GoodsList,Cart,OrderList,AddressList,Collects,Profile,ResetPwd,Goods
urlpatterns = [
    path('admin/', admin.site.urls),
    # 访问域名的时候匹配的视图
    path('', index, name='index'),
    path('login/', Login.as_view(), name='login'),
    path('reg/', Reg.as_view(), name='reg'),
    path('ucenter/',Ucenter.as_view(), name='ucenter'),
    path('goods_list/',GoodsList.as_view(), name='goods_list'),
    path('goods/',Goods.as_view(), name='goods'),
    path('cart/',Cart.as_view(), name='cart'),
    path('order_list/',OrderList.as_view(), name='order_list'),
    path('address_list/',AddressList.as_view(), name='address_list'),
    path('collects/',Collects.as_view(), name='collects'),
    path('profile/',Profile.as_view(), name='profile'),
    path('reset_pwd/',ResetPwd.as_view(), name='reset_pwd'),
]
# django默认没有开启托管静态资源文件的功能
# 开发环境中托管静态资源文件
if settings.DEBUG:
    urlpatterns+=static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
